#ifndef _EEPROM_H_
#define _EEPROM_H_

#include "Global.h"
#include "UserApp.h"

typedef struct 
{
    uint8 Head;
    uint8 CheckSum;
}Typedef_EEPROM_INFO;


typedef struct 
{
    Typedef_EEPROM_INFO Info;
    // uint8 Data[sizeof(Typedef_USER_DATA)];
    Typedef_USER_DATA Data[C_MAX_USER];
}Typedef_EEPROM;

typedef union 
{
    Typedef_EEPROM Detail;
    uint8 Buf[sizeof(Typedef_EEPROM)];
}U_EEPROM;

#define SIZE_OF_EEP_INFO    sizeof(Typedef_EEPROM_INFO)     //
#define SIZE_OF_EEP_PACK    sizeof(Typedef_EEPROM)
#define SIZE_OF_EEP_DAT     (SIZE_OF_EEP_PACK - SIZE_OF_EEP_INFO)        //---- 

// extern U_EEPROM EEP_Data;

uint8 EEP_LoadData(uint16 addr, uint8* buf);
uint8 EEP_SaveData(uint16 addr, uint8* buf);
void UID_Load(uint16 addr,uint8* buf, uint8 length);

#endif